//
//  NSObject+Common.h
//  ContinueEducation
//
//  Created by 迟建国 on 2018/7/10.
//  Copyright © 2018年 CE. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSObject (Common)

NS_ASSUME_NONNULL_BEGIN

NSString * _Nonnull NSDocumentsFolder(void);
NSString *NSCacheFolder(void);

-(id)handleResponse:(id)responseJSON;
-(id)handleResponse:(id)responseJSON autoShowError:(BOOL)autoShowError;
- (BOOL)showError:(NSError *)error;
- (void)showHudTipStr:(NSString *)tipStr;
- (NSString *)dateFormatWithTimeInterval:(NSTimeInterval)time;
- (NSString *)dateFormatyyyy_MM_dd:(NSTimeInterval)time;
- (NSString *)stringFromDate:(NSDate *)date withFormat:(NSString *)format;
- (void)networkReachability;
- (UIViewController *)getKeyWindowRootViewController;
+ (BOOL)saveResponseData:(NSDictionary *)data toPath:(NSString *)requestPath;
+ (id) loadResponseWithPath:(NSString *)requestPath;
- (NSString *)tipFromError:(NSError *)error;
- (NSString *)JsonSting;
// 拨打电话，带弹窗
- (void)telphoneWithNumber:(NSString *)phone;


- (void)alertWithMsg:(NSString *)msg sureBtnTitle:(NSString *)sureTitle cancelBtnTitle:(NSString *)cancelTitle sureHander:(void (^ __nullable)(UIAlertAction *action))sureHander cancelHander:(void (^ __nullable)(UIAlertAction *action))cancelHander;

+ (BOOL)compareWithVersionNewVersion:(NSString *)newVersion;

//+ (void)updataVersionWithIsBackground:(BOOL)isBackground;

+ (BOOL)SystemSelector:(SEL)systemSelector swizzledSelector:(SEL)swizzledSelector error:(NSError *)error;

+ (NSString *)getNetworkReachabilityStatus;

NS_ASSUME_NONNULL_END
@end
